<!--
 * @Author: Rachel 943701297@qq.com
 * @Date: 2022-07-21 22:02:01
 * @LastEditors: Rachel 943701297@qq.com
 * @LastEditTime: 2022-07-22 17:02:27
 * @FilePath: \JSc:\Users\94370\Desktop\面向工作学习\html css\10-CSS 八（第九天）HTML5+CSS3\5-transform3D.html
 * @Description: 
 * 
 * Copyright (c) 2022 by Rachel 943701297@qq.com, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>3D转换</title>
    <style>
      body {
        perspective: 300px;
      }
      .box {
        position: relative;
        width: 200px;
        height: 200px;
        margin: 100px auto;
        transition: all 0.4s;
        transform-style: preserve-3d;
      }
      .front,
      .back {
        position: absolute;
        top: 0;
        left: 0;
        width: 200px;
        height: 200px;
        text-align: center;
        line-height: 200px;
        border-radius: 50%;
        font-size: 30px;
        color: azure;
        transform: translateZ(1px);
      }
      .box:hover {
        transform: rotate3d(0, 1, 0, 180deg);
      }
      .front {
        background-color: pink;
        z-index: 1;
      }
      .back {
        background-color: skyblue;
        transform: rotate3d(0, 1, 0, 180deg);
      }
      .nav {
        width: 500px;
        height: 100px;
        margin: 50px auto;
        perspective: 500px;
      }
      li {
        list-style: none;
        float: left;
        margin: 0 10px;
        text-align: center;
        color: white;
        transform-style: preserve-3d;
        transition: all 0.3s;
      }
      li:hover {
        transform: translateY(-20px) rotateX(90deg);
      }
      .f1,
      .b1 {
        width: 200px;
        height: 40px;
        font-size: 20px;
        line-height: 40px;
      }
      .f1 {
        background-color: black;
        transform: translateZ(20px);
      }
      .b1 {
        background-color: red;
        transform: translateY(-20px) rotateX(-90deg);
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="front">小涓</div>
      <div class="back">阿浩</div>
    </div>
    <ul class="nav">
      <li>
        <div class="f1">郎才</div>
        <div class="b1">女貌</div>
      </li>
      <li>
        <div class="f1">上</div>
        <div class="b1">下</div>
      </li>
    </ul>
  </body>
</html>
